package org.bugjail.dataaccess;

import org.bugjail.dataaccess.jdbc.objects.JDBCDAOFactory;
import org.bugjail.dataaccess.objects.AccessLevelDAO;
import org.bugjail.dataaccess.objects.ConditionDAO;
import org.bugjail.dataaccess.objects.PersonDAO;
import org.bugjail.dataaccess.objects.ProjectDAO;
import org.bugjail.dataaccess.objects.ReferenceDAO;
import org.bugjail.dataaccess.objects.SuiteDAO;
import org.bugjail.dataaccess.objects.TermDAO;
import org.bugjail.dataaccess.objects.TestCaseDAO;
import org.bugjail.dataaccess.objects.TestCaseExecutionDAO;
import org.bugjail.dataaccess.objects.TestCycleDAO;
import org.bugjail.dataaccess.objects.TestDesignDAO;
import org.bugjail.dataaccess.objects.TestReportDAO;
import org.bugjail.dataaccess.objects.TestRoundDAO;

/**
 * This class is a factory of all data access objects of the system. The class
 * implements the singleton pattern to have only one instance of the class
 * accessed by the method getDAOFactory().
 * 
 * @author Edwin Carlo
 * 
 */
public abstract class DAOFactory {

	// Static ------------------------------------------------------------------
	/*
	 * Instance of the DAOFactory class to be returned every time needed in the
	 * system.
	 */
	private static DAOFactory instance;

	/**
	 * Method to return the correct instance of the DAOFactory class.
	 * 
	 * @return The DAOFactory instance.
	 */
	public static synchronized DAOFactory getDAOFactory() {
		if (instance == null) {
			instance = new JDBCDAOFactory();
		}
		return instance;
	}

	// Public ------------------------------------------------------------------
	public abstract AccessLevelDAO getAccessLevelDAO();

	public abstract PersonDAO getPersonDAO();

	public abstract ProjectDAO getProjectDAO();

	public abstract TermDAO getTermDAO();

	public abstract TestCaseDAO getTestCaseDAO();

	public abstract TestDesignDAO getTestDesignDAO();
	
	public abstract ConditionDAO getConditionDAO();
	
	public abstract ReferenceDAO getReferenceDAO();

	public abstract TestReportDAO getTestReportDAO();

	public abstract TestCycleDAO getTestCycleDAO();

	public abstract TestRoundDAO getTestRoundDAO();

	public abstract SuiteDAO getSuiteDAO();
	
	public abstract TestCaseExecutionDAO getTestCaseExecutionDAO();
}
